/*
 * Amazon Software Tecnologia
 * http://www.amazon-software.net
 */
package tv.pojo;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import java.io.Serializable;

import java.util.Date;


/**
 * DOCUMENT ME!
 *
 * @author $Author$
 * @version $Revision$
 */
@Entity
@Table(name = "compras")
public class Compra implements Serializable
{
   @ManyToOne(fetch = FetchType.EAGER)
   @Cascade(CascadeType.ALL)
   @JoinColumn(name = "id_celular", insertable = true, updatable = false)
   private Celular celular;
   @ManyToOne(fetch = FetchType.EAGER)
   @Cascade(CascadeType.ALL)
   @JoinColumn(name = "id_cliente", insertable = true, updatable = false)
   private Cliente cliente;
   @Temporal(TemporalType.DATE)
   @Column(name = "data_compra")
   private Date dataCompra;
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "data_hora_fim")
   private Date dataHoraFim;
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "data_hora_inicio")
   private Date dataHoraInicio;
   @Column(name = "valor_compra")
   private Double valor;
   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   @Column(name = "cod_compra")
   private Long codCompra;
   @Column(name = "status_compra")
   private int status;

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Celular getCelular()
   {
      return celular;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Cliente getCliente()
   {
      return cliente;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Long getCodCompra()
   {
      return codCompra;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Date getDataCompra()
   {
      return dataCompra;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Date getDataHoraFim()
   {
      return dataHoraFim;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Date getDataHoraInicio()
   {
      return dataHoraInicio;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public int getStatus()
   {
      return status;
   }

   /**
    * DOCUMENT ME!
    *
    * @return
    */
   public Double getValor()
   {
      return valor;
   }

   /**
    * DOCUMENT ME!
    *
    * @param celular
    */
   public void setCelular(Celular celular)
   {
      this.celular = celular;
   }

   /**
    * DOCUMENT ME!
    *
    * @param cliente
    */
   public void setCliente(Cliente cliente)
   {
      this.cliente = cliente;
   }

   /**
    * DOCUMENT ME!
    *
    * @param codCompra
    */
   public void setCodCompra(Long codCompra)
   {
      this.codCompra = codCompra;
   }

   /**
    * DOCUMENT ME!
    *
    * @param dataCompra
    */
   public void setDataCompra(Date dataCompra)
   {
      this.dataCompra = dataCompra;
   }

   /**
    * DOCUMENT ME!
    *
    * @param dataHoraFim
    */
   public void setDataHoraFim(Date dataHoraFim)
   {
      this.dataHoraFim = dataHoraFim;
   }

   /**
    * DOCUMENT ME!
    *
    * @param dataHoraInicio
    */
   public void setDataHoraInicio(Date dataHoraInicio)
   {
      this.dataHoraInicio = dataHoraInicio;
   }

   /**
    * DOCUMENT ME!
    *
    * @param status
    */
   public void setStatus(int status)
   {
      this.status = status;
   }

   /**
    * DOCUMENT ME!
    *
    * @param valor
    */
   public void setValor(Double valor)
   {
      this.valor = valor;
   }
}
